package com.basic;

import com.business.socialcredit.SocialCreditFactory;
import com.frame.struts.BaseBean;
import java.util.Date;
import javax.servlet.http.HttpServletRequest;
import com.utils.CommUtil;
import javax.servlet.http.HttpServletResponse;
import com.frame.struts.ActionContext;


/**
 * <p>Title: </p>
 * <p>Description: </p>
 * <p>Copyright: Copyright (c) 2006</p>
 * <p>Company: </p>
 * @author not attributable
 * @version 1.0
 */

public class CurrProjectForm extends BaseBean 
{
	private static final long serialVersionUID = 1L;

	public CurrProjectForm() {
    }

	CurrProjectEntity currProject = new CurrProjectEntity();

	public String addCurrProject() 
	{
		HttpServletRequest request = ActionContext.getActionContext().
		getRequest();
		BasicFactory factory = new BasicFactory();
		String qyid = (String) request.getSession().getAttribute("session_qyid");
		currProject.setQyid(qyid);
		currProject.setOptdate(new Date());
		currProject.setOptrid(CommUtil.getUserId(request));
		currProject.setXh(SocialCreditFactory.getNextXh("qy_zjxm", qyid));
		
		if (factory.addCurrProject(currProject)) {
			//response.sendRedirect("/basic/queryCurrProject.jsp");
			return "success";
		}else
		{
			//response.sendRedirect("/basic/failed.jsp");
			return "failed";
		}
	}

	public String modifyCurrProject(){
			HttpServletRequest request = ActionContext.getActionContext().
				getRequest();
			HttpServletResponse response = ActionContext.getActionContext().
				getResponse();
			BasicFactory factory = new BasicFactory();
			String qyid = (String) request.getSession().getAttribute("session_qyid");
			currProject.setQyid(qyid);
			currProject.setOptdate(new Date());
			currProject.setOptrid(CommUtil.getUserId(request));
			factory.deleteCurrProject(currProject.getXh());
		    if(factory.addCurrProject(currProject))
		    {
		    	//response.sendRedirect("/basic/queryCurrProject.jsp");
				return "success";
			}else
			{
				//response.sendRedirect("/basic/failed.jsp");
				return "failed";
			}
		}
	public double getZhsje() {
		return currProject.getZhsje();
	}
	public void setZhsje(double zhsje) {
		currProject.setZhsje(zhsje);
	}
	public String getKjhl() {
		return currProject.getKjhl();
	}
	public void setKjhl(String kjhl) {
		currProject.setKjhl(kjhl);
	}
	public String getYjwlscxy() {
		return currProject.getYjwlscxy();
	}
	public void setYjwlscxy(String yjwlscxy) {
		currProject.setYjwlscxy(yjwlscxy);
	}

	/**
	* @return Returns the jk.
	*/
	public double getJk() {
	return currProject.getJk();
	}
	/**
	* @param jk The jk to set.
	*/
	public void setJk(double jk) {
	currProject.setJk(jk);
	}
	/**
	* @return currProject. return currProject.s the kssj.
	*/
	public String getKssj() {
	return currProject.getKssj();
	}
	/**
	* @param kssj The kssj to set.
	*/
	public void setKssj(String kssj) {
	currProject.setKssj(kssj);
	}
	/**
	* @return currProject. return currProject.s the optdate.
	*/
	public Date getOptdate() {
	return currProject.getOptdate();
	}
	/**
	* @param optdate The optdate to set.
	*/
	public void setOptdate(Date optdate) {
	currProject.setOptdate(optdate);
	}
	/**
	* @return currProject. return currProject.s the optrid.
	*/
	public String getOptrid() {
	return currProject.getOptrid();
	}
	/**
	* @param optrid The optrid to set.
	*/
	public void setOptrid(String optrid) {
	currProject.setOptrid(optrid);
	}
	/**
	* @return currProject. return currProject.s the qt.
	*/
	public double getQt() {
	return currProject.getQt();
	}
	/**
	* @param qt The qt to set.
	*/
	public void setQt(double qt) {
	currProject.setQt(qt);
	}
	/**
	* @return currProject. return currProject.s the qyid.
	*/
	public String getQyid() {
	return currProject.getQyid();
	}
	/**
	* @param qyid The qyid to set.
	*/
	public void setQyid(String qyid) {
	currProject.setQyid(qyid);
	}
	/**
	* @return currProject. return currProject.s the recstate.
	*/
	public String getRecstate() {
	return currProject.getRecstate();
	}
	/**
	* @param recstate The recstate to set.
	*/
	public void setRecstate(String recstate) {
	currProject.setRecstate(recstate);
	}
	/**
	* @return currProject. return currProject.s the remark.
	*/
	public String getRemark() {
	return currProject.getRemark();
	}
	/**
	* @param remark The remark to set.
	*/
	public void setRemark(String remark) {
	currProject.setRemark(remark);
	}
	/**
	* @return currProject. return currProject.s the xh.
	*/
	public int getXh() {
	return currProject.getXh();
	}
	/**
	* @param xh The xh to set.
	*/
	public void setXh(int xh) {
	currProject.setXh(xh);
	}
	/**
	* @return currProject. return currProject.s the xm.
	*/
	public String getXm() {
	return currProject.getXm();
	}
	/**
	* @param xm The xm to set.
	*/
	public void setXm(String xm) {
	currProject.setXm(xm);
	}
	/**
	* @return currProject. return currProject.s the yjwcsj.
	*/
	public String getYjwcsj() {
	return currProject.getYjwcsj();
	}
	/**
	* @param yjwcsj The yjwcsj to set.
	*/
	public void setYjwcsj(String yjwcsj) {
	currProject.setYjwcsj(yjwcsj);
	}
	/**
	* @return currProject. return currProject.s the yjzjhsq.
	*/
	public String getYjzjhsq() {
	return currProject.getYjzjhsq();
	}
	/**
	* @param yjzjhsq The yjzjhsq to set.
	*/
	public void setYjzjhsq(String yjzjhsq) {
	currProject.setYjzjhsq(yjzjhsq);
	}
	/**
	* @return currProject. return currProject.s the ztz.
	*/
	public double getZtz() {
	return currProject.getZtz();
	}
	/**
	* @param ztz The ztz to set.
	*/
	public void setZtz(double ztz) {
	currProject.setZtz(ztz);
	}
	/**
	* @return currProject. return currProject.s the zyzj.
	*/
	public double getZyzj() {
	return currProject.getZyzj();
	}
	/**
	* @param zyzj The zyzj to set.
	*/
	public void setZyzj(double zyzj) {
	currProject.setZyzj(zyzj);
	}


}